<!-- 模板 -->
<template>
  <el-dialog class="keys-verify-wp"
    title="提示"
    :visible.sync="visible"
    width="430px"
    @close="handleClose">
    <div class="row">
      <i class="this-icon el-icon-warning"></i>
      <div class="text">包含非法关键字 <span class="keys">{{aMsg.join('，')}}</span> 请重新输入！</div>
    </div>
    <span class="list-btn" @click="show = !show">所有非法关键字列表</span>
    <el-collapse-transition>
      <div v-show="show" class="list">
        <div v-for="(item, index) in list" :key="index" class="item">{{item}}</div>
      </div>
    </el-collapse-transition>

    <div slot="footer" class="dialog-footer">
      <el-button size="small" type="primary" @click="visible = false">确 定</el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: 'keys-verify',
  data () {
    return {
      visible: false,
      show: false,
      aMsg: '',
      list: [], // 禁止列表
    }
  },
  methods: {
    open () {
      this.visible = true;
    },
    handleClose () {
      this.$el.parentNode.removeChild(this.$el);
    }
  }
}
</script>
<style>
.keys-verify-wp {
  text-align: center;
}
.keys-verify-wp:after {
  content: '';
  display: inline-block;
  width: 0;
  height: 100%;
  vertical-align: middle;
}
.keys-verify-wp .el-dialog {
  display: inline-block;
  margin: 0 !important;
  padding-bottom: 10px;
  text-align: left;
  vertical-align: middle;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  line-height: 24px;
}
.keys-verify-wp .el-dialog__header {
  position: relative;
  padding: 15px 15px 10px;
}
.keys-verify-wp .el-dialog__title {
  font-size: 18px;
  line-height: 1;
  color: #303133;
}
.keys-verify-wp .el-dialog__headerbtn {
  top: 50%;
  margin-top: -8px;
}
.keys-verify-wp .el-dialog__body {
  padding: 10px 15px;
  overflow: hidden;
  box-sizing: border-box;
}
.keys-verify-wp .el-dialog__footer {
  padding: 5px 15px 0;
}
</style>
<style scoped>
.keys-verify-wp .row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
}
.keys-verify-wp .this-icon {
  margin-right: 10px;
  color: #F56C6C;
  font-size: 24px;
}
.keys-verify-wp .keys {
  color: #F56C6C;
}
.keys-verify-wp .list-btn {
  display: inline-block;
  color: #409EFF;
  line-height: 34px;
  cursor: pointer;
}
.keys-verify-wp .list:after {
  content: '';
  display: block;
  clear: both;
}
.keys-verify-wp .list .item {
  float: left;
  margin: -1px 0 0 -1px;
  padding: 0 10px;
  width: 33%;
  line-height: 26px;
  box-sizing: border-box;
  border: 1px solid #ccc;
}
</style>
